package custom.reflection;

import custom.po.Student;
import org.apache.ibatis.annotations.Flush;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.binding.MapperMethod;

import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
import java.util.*;

public class ReflectionTest {
	public static void main(String[] args) throws ClassNotFoundException, NoSuchMethodException {
		Class<?> aClass = Class.forName("custom.po.Student");
		Method study = aClass.getMethod("study", String.class, Object.class,Integer.class);
		Object[] parameterAnnotations = study.getParameterAnnotations()[0];
		/*for (Object paramAnno : parameterAnnotations) {
			if (paramAnno instanceof Param) {
				String paramName = ((Param) paramAnno).value();
				System.out.println(paramName);
			}
		}*/
		final SortedMap<Integer,String> parm=new TreeMap<Integer, String>();
		for(int a=0;a<3;a++){
			if(a==0){
				parm.put(a,"123");
			}
			if(a==1){
				parm.put(a,String.valueOf(parm.size()));
			}
			if(a==2){
				parm.put(a,String.valueOf(parm.size()));
			}
		}
		System.out.println(parm);
		final Map<String, Object> param = new MapperMethod.ParamMap<Object>();
		Set<Map.Entry<Integer, String>> entries = parm.entrySet();
		Object[] objects ={};
		/*for(Map.Entry<Integer,String> entry:entries){
			Integer key = entry.getKey();
			String value = entry.getValue();
			System.out.println(key);
			System.out.println(value);
		}*/
		param.put("123","张三");
		param.put("param1","张三");

	}
}
